﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace homework5_8
{
    class Program
    {
        static void Main(string[] args)
        {
            bool flag = true;
                Console.WriteLine("请输入身份证号");
            string ID=Console.ReadLine();
            for (int i = 0; i < ID.Length-1; i++)
            {
                if (ID[i] >= '0' && ID[i] <= '9')
                { continue; }
                else
                    flag = false;
            }
            if (ID.Length == 18)
            {
                if (flag == true)
                    Console.WriteLine("输入正确");
                else if (flag == false)
                    Console.WriteLine("输入不合法，请0重新输入");
            }
            else
                Console.WriteLine("输入不合法，请重新输入");
            Console.ReadKey();

        }
    }
}
